@use "../../../stylesheets/mixins";

.searchBox {
  z-index: 1;
  top: 3rem;
  width: 100%;
}

.searchInput {
  box-shadow: var(--shadow-overlay);
  font-size: var(--font-size-xl);
  padding: 0.8rem 1.2rem;
  border: var(--separator-size) solid var(--separator-color);
  cursor: text;

  @media (max-width: 480px) {
    padding: 0.5rem 1rem;
  }
}

.searchBoxCompact .searchInput {
  box-shadow: none;
  font-size: var(--font-size-regular);
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--separator-color);
  font-weight: 400;

  &::placeholder {
    color: var(--font-color-subtext-dark);
  }

  @media (max-width: 480px) {
    padding: 0.3rem 0.8rem;
  }
}

.searchBoxCompact .searchInput:focus {
  border: 1.5px solid var(--selected-stroke-color);
}

.searchInput,
.searchSuggestionMenu {
  width: 100%;
}

.searchInput::placeholder {
  text-align: center;
  letter-spacing: -0.2px;
}

.searchSuggestionMenu,
.versionMenu {
  @include mixins.popup;
  @include mixins.hideScrollbar;
  border-radius: 0 0 4px 4px;
  list-style: none;
  box-shadow: var(--shadow-overlay);
  position: absolute;
  backdrop-filter: blur(10px);
  background: var(--primary-bg-color-highlight);

  li {
    cursor: pointer;
    border-radius: 5px;
  }
}

.inputWrapper {
  display: flex;
  align-items: center;
}

.searchSuggestionMenu {
  width: clamp(30rem, 35vw, 40rem);
  max-width: 85vw;
  margin: -4px 0 0;

  &:not(:empty) {
    padding: 15px 10px 10px;
  }

  li {
    padding: 10px 10px;

    &[aria-selected="true"] {
      background: var(--hover-bg);
    }
  }
}

.versionDropdown {
  justify-self: flex-end;
  position: absolute;
  right: 0;
  height: 100%;
  display: flex;
  align-items: center;

  &:before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 50%;
    background: var(--separator-color);
  }
}

.versionDropdownToggle {
  display: flex;
  align-items: center;
  font-variant-numeric: tabular-nums;

  padding: 0 1.2rem;

  @media (max-width: 480px) {
    padding: 0 1rem;
  }
}

.versionMenu {
  max-height: 30vh;
  overflow-y: scroll;
  font-variant-numeric: tabular-nums;
  top: 75%;

  &:not(:empty) {
    padding: 10px 5px 5px;
  }

  li {
    padding: 5px 8px;

    &:hover {
      background: var(--hover-bg);
    }

    &[aria-selected="true"] {
      color: var(--selected-text-color);
      font-weight: var(--font-weight-bold);
    }
  }
}

.versionDropdownLabel {
  color: var(--selected-text-color-subdued-more);
  font-family: var(--font-family-code);
  margin-right: 5px;
}

.resultName {
  font-weight: var(--font-weight-bold);

  .searchHighlight {
    @include mixins.selectedLabel;
  }
}

.resultDescription {
  //font-weight: var(--font-weight-light);
  font-size: var(--font-size-sm);
  color: var(--font-color-subtext);
  font-family: var(--font-family-system);

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  max-width: 80vw;

  .searchHighlight {
    color: var(--selected-text-color-subdued);
  }
}

.comboBoxContainer {
  position: relative;
  z-index: 1;
}
